package smj;

public class Course {
    String Cname;
    String Cnum;
    int Credit;
    String teacher;

    public Course(String Cname, String Cnum, int Credit, String teacher) {
        this.Cname = Cname;
        this.Cnum = Cnum;
        this.Credit = Credit;
        this.teacher = teacher;
    }

    public void print() {
        System.out.println("课程名称: " + Cname);
        System.out.println("课程编号: " + Cnum);
        System.out.println("学分: " + Credit);
        System.out.println("任课老师: " + teacher);
    }

    public static void main(String[] args) {
        // 在创建Course对象时，传递任课老师的名字
        Course course = new Course("Java编程", "112233", 4, "张老师");
        course.print();
    }
}

